import { LazyExoticComponent, Suspense } from "react";
import Spinner from "@/components/spinner";
/**
 * 实现路由懒加载
 * @param Comp 懒加载组件
 * @returns
 */
const lazyLoad = (Comp: LazyExoticComponent<any>) => {
  return (
    <Suspense fallback={<Spinner />}>
      <Comp />
    </Suspense>
  );
};

export default lazyLoad;
